package com.kuang.demo3.impl;

import com.kuang.demo3.Shape;

import java.util.Scanner;

/**
 * @Title:
 * @Description:
 * @Author: zx
 * @Date: create in 14:27 2020/8/7
 * @Version: 1.0
 */
public class Square implements Shape {

    //长
    public int length;

    public Object clone() {
        Square square = null;
        try {
            square = (Square) super.clone();
        } catch (CloneNotSupportedException e) {
            System.out.println("拷贝正方形失败!");
        }
        return square;
    }

    public void countArea() {
        System.out.print("这是一个正方形，请输入它的边长：");
        Scanner input = new Scanner(System.in);
        length = input.nextInt();
        System.out.println("该正方形的面积=" + length * length + "\n");
    }
}
